Philadelphia police sold nearly 900 used guns, investigation finds