v4l2: Fix encoder registration failure and leaks
The registration code was overwriting caps using later in the process of registration of other CODECs, causing some encoder to not be registered or leading to negotiation issues.
cc @philn
Edited by Tim-Philipp Müller