The ‘Peep Show’ star plays a puzzle expert plunged into a police procedural in this new BBC One comedy-drama