Vector-Quantized Latent Flows for Medical Image Synthesis and Out-Of-Distribution Detection