The Warriors nearly blew an 18-point lead, but Malik Beasley's missed three secured the win over the Pistons