firmware: Fix freeing of dispman elements and resources on exit after errors