Prompt Optimization Meets Subspace Representation Learning for Few-shot Out-of-Distribution Detection