erp5_hal_json_style: set the locked status only at the end

Prevent potential errors to be returned with 201 status
8 jobs for master in 0 seconds
Status Job ID Name Coverage
  External
failed ERP5.CodingStyleTest-Master

02:27:52

failed ERP5.PerformanceTest-Master

00:40:14

failed ERP5.UnitTest-Master

02:10:31

passed SlapOS.Eggs.UnitTest-Master.Python2

00:25:42

passed SlapOS.Eggs.UnitTest-Master.Python3

00:32:14

passed Wendelin.UnitTest-Master

00:36:17

passed Wendelin.UnitTest-Master

00:39:05

passed Wendelin.UnitTest-Master

01:25:33