Entrapment of pusher and puller bacteria near a solid surface