Residents are not required to undergo a background check every time they purchase bullets, the judge ruled