Thousands attend funeral for 'hero' NYPD officer who 'loved life'