Brexit court ruling could unintentionally offer PM renewed hope of October 31 exit