Former police officer sentenced to prison on gun charges