Police are allowed to lie especially to resolve hostage situations. There's no reason they couldn't just tell John his son's name is on the list and then arrest him as soon as he walks out. This was actually suggested by an officer in the film, but simply ignored by everyone.
When John attempts to kill himself, he pulls the trigger and the hammer falls, but the gun does not go off because he says the safety is on. When a Beretta's safety is on, the hammer cannot be in the cocked position and the trigger mechanism is disabled, thus the hammer could not have fallen and pulling the trigger would have had no effect anyway.