Security footage shows homeless men helping cop subdue violent attacker